//
//  CZMenuitemViewModel.m
//  i0S007通用项目
//
//  Created by Apple on 16/2/19.
//  Copyright © 2016年 Apple. All rights reserved.
//

#import "CZMenuItemViewModel.h"
#import "CZMenuItem.h"

@implementation CZMenuItemViewModel

- (NSArray *)compseItems {
    if (_compseItems == nil) {
        // .生成按钮相关的数据
        NSArray *array = @[@{@"title": @"发说说", @"imageName": @"tabbar_mood", @"composeButton": @YES, @"detailContentVCName": @"CZMoodViewController"},
                           @{@"title": @"传照片", @"imageName": @"tabbar_photo", @"composeButton": @YES, @"detailContentVCName": @"CZPhotoViewController"},
                           @{@"title": @"写日志", @"imageName": @"tabbar_blog", @"composeButton": @YES, @"detailContentVCName": @"CZBlogViewController"}];
        
        NSMutableArray *items = [NSMutableArray array];
        
        // 3.1字典转模型
        for (NSDictionary *dict in array) {
            CZMenuItem *menuItem = [CZMenuItem menuItemWithDict:dict];
            
            [items addObject:menuItem];
        }
        
        // 一定要记得赋值
        _compseItems = items;
    }
    
    return _compseItems;
}

- (NSArray *)menuItems {
    if (_menuItems == nil) {
        // 4.生成按钮相关的数据
        NSArray *array = @[@{@"title": @"全部动态", @"imageName": @"tab_bar_feed_icon", @"detailContentVCName": @"CZHomeViewController"},
                           @{@"title": @"与我相关", @"imageName": @"tab_bar_passive_feed_icon", @"detailContentVCName": @"CZAboutMeViewController"},
                           @{@"title": @"照片墙", @"imageName": @"tab_bar_pic_wall_icon", @"detailContentVCName": @"CZPictureWallViewController"},
                           @{@"title": @"电子相框", @"imageName": @"tab_bar_e_album_icon", @"detailContentVCName": @"CZAlbumViewController"},
                           @{@"title": @"好友", @"imageName": @"tab_bar_friend_icon", @"detailContentVCName": @"CZMyFriendsViewController"},
                           @{@"title": @"更多", @"imageName": @"tab_bar_e_more_icon", @"detailContentVCName": @"CZMoreViewController"}];
        
        NSMutableArray *items = [NSMutableArray array];
        
        // 4.1字典转模型
        for (NSDictionary *dict in array) {
            CZMenuItem *menuItem = [CZMenuItem menuItemWithDict:dict];
            
            [items addObject:menuItem];
        }
        
        _menuItems = items;
    }
    
    return _menuItems;
}
@end
